import React, { useState } from 'react';

let selfCount = 0;
const TestFunState = function () {
    const [count, setCount] = useState(0);
    const clickFun = () => {
        selfCount += 1;
        setTimeout(() => {
            setCount(() => count + 1);
        }, 1000);
    };
    const disNum = function () {
        console.log(selfCount);
    };
    return (
        <div>
            <div>{count}</div>
            <div aria-hidden="true" onClick={clickFun}>
                加数字
            </div>
            <div aria-hidden="true" onClick={disNum}>
                真实结果
            </div>
        </div>
    );
};
export default TestFunState;
